#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int main()
{
	int num = 0;
	scanf("%d", &num);
	int i = 0;
	for (i; i < 32; i += 2)
	{
		if(num & (1 << i))
			printf("%d ", 1);
		else
			printf("%d ", 0);
	}
	printf("\n");
	for (i = 1; i < 32; i += 2)
	{
		if (num & (1 << i))
			printf("%d ", 1);
		else
			printf("%d ", 0);
	}
	return 0;
}